package com.wzh.core.api;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

/**
 * @description: rpc请求包含内容
 * @author: wangzouhuax
 */
@Data
@AllArgsConstructor
public class RpcContent<T> {

    private List<Filter> filters;

    private Router<T> router;

    private LoadBalance<T> loadBalance;


    /**
     * RpcContent类用于存储过滤器、路由器和负载均衡器信息。
     */
    public RpcContent(Router router, LoadBalance loadBalance) {
        this.router = router;
        this.loadBalance = loadBalance;
    }

    /**
     * 使用Builder模式创建RpcContent实例。
     */
    public static <T> RpcContent<T> create(Router router, LoadBalance loadBalance) {
        return new RpcContent<>(router, loadBalance);
    }


}
